from urllib.request import urlopen
from bs4 import BeautifulSoup
from urllib.error import HTTPError

try:
    x=urlopen('https://www.runoob.com/egexp/regexp-rule111222121212121.html')
except HTTPError as e:
    print(e)
    
else:
    print('It is working!')

x=urlopen('https://www.runoob.com/regexp/regexp-rule.html')
'''print(x.read())'''
y=BeautifulSoup(x,'html.parser')
print(y.title)
